import request from 'umi-request';
import { extendRequest } from '@/utils/request';

// const extndRequest=extend({
//   prefix: 'http://101.37.119.231:20000',
//   timeout: 1000,
//   headers: {
//     'Content-Type': 'application/json',
//   },
// })

export async function queryPermit(params) {
  return request('/api/rule', {
    params,
  });
}
export async function removePermit(params) {
  return request('/api/rule', {
    method: 'POST',
    data: {
      ...params,
      method: 'delete',
    },
  });
}
export async function addPermit(params) {
  return request('/api/rule', {
    method: 'POST',
    data: {
      ...params,
      method: 'post',
    },
  });
}

export async function queryUser(params) {
  return request('/api/rule', {
    params,
  });
}
export async function queryDepart(params) {
  return request('/api/rule', {
    params,
  });
}

//模拟
export async function getList(params) {
  return extendRequest('/sysmember/list', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
//添加
export async function addList(params) {
  return extendRequest('/sysmember/add', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
//编辑
export async function updateList(params) {
  return extendRequest('/sysmember/update', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
//删除
export async function removeList(params) {
  return extendRequest('/sysmember/delete', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
